// service.component.ts
import {Component, Inject, OnInit} from "@angular/core";
import {CommentTyeInjectionToken, CommentType} from "./common/Comments";

@Component({
  template: `

  `,
  providers: [{provide: CommentTyeInjectionToken, useValue: {id: '0001', name: 'Jack', body: 'BBBB'}}]
})
export class ServiceComponent implements OnInit {

  private name: string

  constructor(@Inject(CommentTyeInjectionToken) private commentType: CommentType) {
    this.name = this.commentType.name;
  }

  ngOnInit(): void {
  }

}
